package com.sinopec.basemodule.utils

import com.alibaba.android.arouter.launcher.ARouter
import com.sinopec.basemodule.model.StockInListModel
import com.sinopec.basemodule.model.StockOutListModel

/**
 * @author lwj
 * @ClassName: ARouterManagerUtils
 * @Description: ARouter管理类
 */
object ARouterManagerUtils {
    /**********************APP module************************/
    //登录界面
    const val GOTO_LM_LOGIN_ACTIVITY = "/lm/LoginActivity"

    //主界面
    const val GOTO_LM_MAIN_ACTIVITY = "/lm/MainActivity"

    //设置界面
    const val GOTO_LM_SET_ACTIVITY = "/lm/SetActivity"

    //跳转到无数据fragment
    const val GOTO_BM_NO_DATA_FRAGMENT = "/bm/NoDataFragment"

    /**
     * 登录界面
     */
    @JvmStatic
    fun gotoLoginActivity() {
        ARouter.getInstance().build(GOTO_LM_LOGIN_ACTIVITY).navigation()
    }

    /**
     * 主界面
     */
    @JvmStatic
    fun gotoMainActivity() {
        ARouter.getInstance()
            .build(GOTO_LM_MAIN_ACTIVITY)
            .navigation()
    }

    /**
     * 设置界面
     */
    @JvmStatic
    fun gotoSetActivity() {
        ARouter.getInstance()
            .build(GOTO_LM_SET_ACTIVITY)
            .navigation()
    }


    /////////////////////////////////out/////////////////////////////////////////

    /**********************stockOut module************************/
    const val STOCK_OUT_DETAIL_ACTIVITY = "/out/DetailActivity"

    //出库-rfid扫码界面
    const val GOTO_OUT_STOCK_OUT_RFID_ACTIVITY = "/out/StockOutRfidActivity"

    //出库列表
    const val GOTO_OUT_STOCK_OUT_LIST_ACTIVITY = "/out/StockOutListActivity"

    /**
     * 出库-详情
     */
    fun gotoStockOutDetail(stockOutListModel: StockOutListModel) {
        ARouter.getInstance()
            .build(STOCK_OUT_DETAIL_ACTIVITY)
            .withParcelable("stockOutListModel", stockOutListModel)//出库列表
            .navigation()
    }

    /**
     * 出库列表
     */
    @JvmStatic
    fun gotoStockOutListActivity() {
        ARouter.getInstance()
            .build(GOTO_OUT_STOCK_OUT_LIST_ACTIVITY)
            .navigation()
    }

    /////////////////////////////////in/////////////////////////////////////////

    /**********************stockIn module************************/
    const val STOCK_IN_DETAIL_ACTIVITY = "/in/DetailActivity"

    //入库-rfid扫码界面
    const val GOTO_IN_STOCK_IN_RFID_ACTIVITY = "/in/StockINRfidActivity"

    //入库列表
    const val GOTO_IN_STOCK_IN_LIST_ACTIVITY = "/in/StockINListActivity"

    /**
     * 入库-详情
     */
    fun gotoStockInDetail(stockInListModel: StockInListModel) {
        ARouter.getInstance()
            .build(STOCK_IN_DETAIL_ACTIVITY)
            .withParcelable("stockInListModel", stockInListModel)//入库列表
            .navigation()
    }

    /**
     * 入库列表
     */
    @JvmStatic
    fun gotoStockInListActivity() {
        ARouter.getInstance()
            .build(GOTO_IN_STOCK_IN_LIST_ACTIVITY)
            .navigation()
    }
}